<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>文件上传</h1>
<form action="">
  <input type="text" name="intro" placeholder="图片介绍">
  <input type="file" name="picFile">
  <input type="button" value="开始上传" @click="f()">
</form>
<a href="/list.html">列表页面</a>
<!--引入CDN服务器的框架文件-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.js"></script>

<script>
  let v = new Vue({
    el:"form",
    methods:{
      f:function (){
        let data = new FormData(document.querySelector("form"));
        axios.post("/insert",data).then(function (){alert("上传完成")})
      }
    }
  })
</script>
</body>
</html>